package com.smalluz.ad.modules.ks.enums;

import java.util.Arrays;

import lombok.AllArgsConstructor;
import lombok.Getter;

public interface KsApiEnum {

    String getMsg();

    @AllArgsConstructor
    @Getter
    enum ClueIntentionEnum implements KsApiEnum {

        CI0(0, "未标记"), CI1(1, "无意向"), CI2(2, "潜在客户"),
        CI3(3, "高价值客户"), CI4(4, "已成单"),UNKNOWN(99,"未知");

        private final Integer code;

        private final String msg;

        /**
         * 通过code获取描述值
         * @param code
         * @return
         */
        public static String getMsgByCode(Integer code) {
            return Arrays.stream(ClueIntentionEnum.values()).filter(cse -> cse.getCode().equals(code)).findFirst().orElse(ClueIntentionEnum.UNKNOWN).getMsg();
        }


    }

    @AllArgsConstructor
    @Getter
    enum BizSourceEnum implements KsApiEnum {

        BS1003(1003, "建站"), BS1005(1005, "线索通"), BS1007(1007, "投放平台"),
        BS1008(1008, "联盟广告"), BS1010(1010, "虚拟商品推广"),UNKNOWN(99,"未知");

        private final Integer code;

        private final String msg;

        /**
         * 通过code获取描述值
         * @param code
         * @return
         */
        public static String getMsgByCode(Integer code) {
            return Arrays.stream(ClueIntentionEnum.values()).filter(cse -> cse.getCode().equals(code)).findFirst().orElse(ClueIntentionEnum.UNKNOWN).getMsg();
        }

    }

    @AllArgsConstructor
    @Getter
    enum ChannelFlag implements KsApiEnum {

        CF1(1, "广告流量"), CF2(2, "其他"),UNKNOWN(99,"未知");

        private final Integer code;

        private final String msg;

        /**
         * 通过code获取描述值
         * @param code
         * @return
         */
        public static String getMsgByCode(Integer code) {
            return Arrays.stream(ClueIntentionEnum.values()).filter(cse -> cse.getCode().equals(code)).findFirst().orElse(ClueIntentionEnum.UNKNOWN).getMsg();
        }


    }




}
